import service from "../utils/request";

export function getServerList(current, filterParam) {
  return service.post("/api/server/list", filterParam, {
    params: {
      current,
    },
  });
}

export function getServer(id) {
  return service.get(`/api/server/get/${id}`);
}

export function saveOrUpdateServer(server) {
  return service.post("/api/server/saveOrUpdate", server);
}

export function deleteServer(id) {
  return service.post(`/api/server/delete/${id}`);
}

export function setServerState(id, state) {
  return service.post(`/api/server/setState/${id}?state=${state}`);
}

export function setServerTitle(id, title) {
  return service.post(`/api/server/setTitle/${id}?title=${title}`);
}
